//
//  CZGroupBuying.m
//  A01- 团购
//
//  Created by Rainy Zou on 15/11/22.
//  Copyright © 2015年 Rainy Zou. All rights reserved.
//

#import "CZGroupBuying.h"

@implementation CZGroupBuying

-(instancetype)initWithDict:(NSDictionary *)dic
{
    if(self = [super init]){
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+(instancetype)groupBuyingWithDict:(NSDictionary *)dic
{
    return [[self alloc] initWithDict:dic];
}

+(NSMutableArray *)groupBuyingsList
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"tgs" ofType:@"plist"];
    NSArray *dicArray = [NSArray arrayWithContentsOfFile:path];
    
    NSMutableArray *tempArray = [NSMutableArray array];
    for (NSDictionary *dic in dicArray) {
        CZGroupBuying *groupBuying = [CZGroupBuying groupBuyingWithDict:dic];
        [tempArray addObject:groupBuying];
    }
    return tempArray;
}

@end
